<?php

require 'basehandle.php';
require '../dao/userdao.php';

class Regchehandle implements basehandle{
	public function dohandle(){
		$name=$_POST['name'];
		$pwd=$_POST['password'];
		
 		//echo $rs;
 		if($name==null) {
			$info=array("rs"=>"error","errorinf"=>"请输入用户名");
		}
		else{
		$dao=new userdao();
 		$rs=$dao->regcheck($name);
		if($rs==0){
			$info=array("rs"=>"success","successinf"=>"用户名可注册");
		}
		
		else{
			$info=array("rs"=>"error","errorinf"=>"用户名已存在");
		}	
	   }
	   echo json_encode($info);
	}
	
}

?>